package com.xc.hotelmgr.webapi.modules.dt.service.impl;

import com.xc.hotelmgr.webapi.common.utils.PageUtils;
import com.xc.hotelmgr.webapi.common.utils.Query;
import com.xc.hotelmgr.webapi.modules.dt.dao.DtOrderChannelsDao;
import com.xc.hotelmgr.webapi.modules.dt.entity.DtOrderChannelsEntity;
import com.xc.hotelmgr.webapi.modules.dt.service.DtOrderChannelsService;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;



@Service("dtOrderChannelsService")
public class DtOrderChannelsServiceImpl extends ServiceImpl<DtOrderChannelsDao, DtOrderChannelsEntity> implements DtOrderChannelsService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<DtOrderChannelsEntity> page = this.page(
                new Query<DtOrderChannelsEntity>().getPage(params),
                new QueryWrapper<DtOrderChannelsEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public DtOrderChannelsEntity getByStoreId(Integer storeId) {
        return baseMapper.getByStoreId(storeId);
    }

    @Override
    public DtOrderChannelsEntity getByStoreIdAndChanel(Integer storeId, Integer chanel) {
        return baseMapper.getByStoreIdAndChannel(storeId, chanel);
    }

}